package com.codeplay.domain.repository;

import com.codeplay.domain.entity.ChildUser;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface ChildUserRepository extends JpaRepository<ChildUser, Long> {
    Optional<ChildUser> findByUsername(String username);
    List<ChildUser> findByParentId(Long parentId);
    Page<ChildUser> findByAgeBetween(Integer minAge, Integer maxAge, Pageable pageable);
    Page<ChildUser> findByLevelGreaterThanEqual(Integer level, Pageable pageable);
    Optional<ChildUser> findByDeviceId(String deviceId);
} 